/*
 * hardware.h
 *
 * Created: 2013/12/26 17:00:04
 *  Author: alivehex
 */ 


#ifndef HARDWARE_H_
#define HARDWARE_H_

#include <avr/io.h>
#include <avr/cpufunc.h>
#include <avr/interrupt.h>
#include <avr/wdt.h>
#include <util/delay.h>

#define USB_HWDR_SIZEB		80
#define USB_HRDW_SIZEB		80
#define PLC_HWDR_SIZEB		80
#define PLC_HRDW_SIZEB		80

#define MOSI_PORT	B
#define MOSI_PIN	(1 << 5)	

#define MISO_PORT	B
#define MISO_PIN	(1 << 6)	

#define SPCK_PORT	B
#define SPCK_PIN	(1 << 7)	

#define NPCS_PORT	B
#define NPCS_PIN	(1 << 4)	

#define IRQ_PORT	B
#define IRQ_PIN		(1 << 2)	

#define CE_PORT		B
#define CE_PIN		(1 << 3)	

#define LED_PORT	B
#define LED_PIN		(1 << 1)	

#define IR_CTRL_PORT	D
#define IR_CTRL_PIN		(1 << 6)	

#define IR_PWM_PORT		D
#define IR_PWM_PIN		(1 << 5)	

#define ROLE_MODE_PORT	A
#define ROLE_MODE_PIN	(1 << 6)

#define DS18B20_PORT	C
#define DS18B20_PIN		(1 << 3)

#define BLRST_PORT		A
#define BLRST_PIN		(1 << 5)

#define BLAT_PORT		A
#define BLAT_PIN		(1 << 6)

#define BOARD_DBG_PORT	D
#define BOARD_DBG_RXD	(1 << 0)	
#define BOARD_DBG_TXD	(1 << 1)	

#endif /* HARDWARE_H_ */